<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>

{{ facebook_status_form.as_ul }}
<li>
{% if facebook_status_user_connected %}
    {% if not facebook_status_perm_ok %}
        <fb:prompt-permission perms="offline_access, status_update">
            To use this plugin you have to authorize us to update your status and access when you are offline?
        </fb:prompt-permission>
        <script type="text/javascript">  FB.init("{{ facebook_status_api_key }}", "/accounts/xd_receiver.htm"); </script>
    {% endif %}
{% else %}
    <script type="text/javascript">
    function facebook_onlogin(){
        window.location = "{% url facebook_status_connect_done %}"

    }
    </script>
    <fb:login-button onlogin="facebook_onlogin();"></fb:login-button>

    <script type="text/javascript">  FB.init("{{ facebook_status_api_key }}", "/accounts/xd_receiver.htm"); </script>
{% endif %}

</li>
